package cn.like.feign;

import cn.like.base.support.result.Rest;
import cn.like.common.context.ServiceNameConstants;
import cn.like.common.dto.SignInRequestDto;
import cn.like.entity.AuthUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author like 980650920@qq.com
 * @date 2021/7/12 21:39
 */
@FeignClient(value = ServiceNameConstants.ADMIN_SERVICE_NAME)
public interface AuthUserFeignService {

    @GetMapping("/admin/findResourceCodeByUserId")
    Rest<List<String>> findResourceCodeByUserId(@RequestParam("userId") Object userId);

    @GetMapping("/admin/findUserRoleByUserId/")
    Rest<List<String>> findUserRoleByUserId(@RequestParam("userId") Object userId);

    @PostMapping("/admin/createUser")
    Rest<AuthUser> createAuthUser(@RequestBody SignInRequestDto signInRequestDto);

    @GetMapping("/admin/findByAccount")
    Rest<AuthUser> findByAccount(@RequestParam("account") String account);
}
